/*
  This material contains proprietary software of Entropic Speech, Inc.   
  Any reproduction, distribution, or publication without the prior	   
  written permission of Entropic Speech, Inc. is strictly prohibited.
  Any public distribution of copies of this work authorized in writing by
  Entropic Speech, Inc. must bear the notice			
 								
      "Copyright (c) 1987 Entropic Speech, Inc.; All rights reserved"
 				
*/


static char *sccs_id = "%W%	%G%	ESI";
 	
#include <stdio.h>
#include <sps/sps.h>

#define SYNTAX USAGE ("hdshrink infile output (or '-' for stdio)")

main(argc,argv)
int argc;
char **argv;
{
	FILE *f1strm = stdin;
	FILE *f2strm = stdout;
	char *f1name = "<stdin>";
	char *f2name = "<stdout>";
	int c;
	struct header *f1hd, *f2hd;

	if (argc != 3) SYNTAX;

	f1name = argv[1];
	if (strcmp(f1name,"-") != 0) 
	 TRYOPEN("hdshrink",f1name,"r",f1strm);
	f2name = argv[2];
	if (strcmp(f2name,"-") != 0)
	 TRYOPEN("hdshrink",f2name,"w",f2strm);

	if(!(f1hd = read_header(f1strm))) NOTSPS(argv[0],f1name);
	f2hd = copy_header(f1hd);
	strcpy(f2hd->common.prog,f1hd->common.prog);
	strcpy(f2hd->common.vers,f1hd->common.vers);
	strcpy(f2hd->common.progdate,f1hd->common.progdate);
	f2hd->variable.comment = f1hd->variable.comment;
	(void) add_comment(f2hd,get_cmd_line(argc,argv));
	write_header(f2hd,f2strm);
	while ((c = getc(f1strm)) != EOF)
		(void) putc(c,f2strm);
	
}

